<?php
/**
 */
class FinalView_Form_Element_Date extends Zend_Form_Element_Xhtml

{
    /**
     * Use formSelect view helper by default
     * @var string
     */
    public $helper = 'formDate';
    
    /**
     * Validate element value
     *
     * @param  mixed $value
     * @param  mixed $context
     * @return boolean
     */
    public function isValid ($value, $context = null)
    {
        $name = $this->getName();
        
        $value = sprintf("%04d-%02d-%02d", 
            $context[$name . '_year'], 
            $context[$name . '_month'], 
            $context[$name . '_day']);
                    
        $this->_value = $value;
        
        return parent::isValid($value, $context);
    }
    
}
